/*
* Licensed under the Apache License, Version 2.0 (the "License"):
*    http://www.apache.org/licenses/LICENSE-2.0
*/
package {
import com.google.maps.controls.ControlBase;
import com.google.maps.controls.ControlPosition;
import com.google.maps.interfaces.IMap;

import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.display.DisplayObject;
import flash.net.*;


public class LogoControl extends ControlBase {
	
	[Embed(source="images/norad_logo.png")]
   	private var NoradLogo:Class;
   	
  /**
   * Constructor of custom control.
   * @constructor.
   * @param controlColour  Colour transform applied to control's black buttons.
   */
  public function LogoControl() {
    super(new ControlPosition(ControlPosition.ANCHOR_BOTTOM_RIGHT, 160, 60));
  }


  public override function initControlWithMap(map:IMap):void {
  	var button:Sprite = new Sprite();
  	button.buttonMode = true;
  	button.useHandCursor = true;
    button.addChild(new NoradLogo());
    
    button.addEventListener(MouseEvent.CLICK, function(e:Event):void {
        var request:URLRequest = new URLRequest("http://www.noradsanta.org");
        navigateToURL(request, "_blank");
    });
    addChild(button);     
     
  }
}
}
